<script>
	export default {
		onLaunch() {
			console.log("===")
			setInterval(res=>{
				this.refreToken();
			},30000)
		},
		onShow() {
			console.log('App Show')
		},    
		onHide()  {
			console.log('App Hide')
		},
		methods: {
			refreToken(){
				var data = {
					'refreshToken':uni.getStorageSync("userInfo").data.token.refresh_token
				};
				this.$axios
					.axios('post', this.$paths.getRefreshTokenPost, data)
					.then((res) => {
						console.log("res",res);
						var userInfo=uni.getStorageSync("userInfo");
						if(res.refresh_token){
							userInfo.data.token.refresh_token=res.refresh_token;
						}
						if(res.access_token){
							userInfo.data.token.access_token=res.access_token;
						}
						uni.setStorageSync("userInfo",userInfo);
						
					})
					.catch((err) => {
						console.log('错误回调', err);
					});
			}
		}
	} 
</script>

<style lang="scss">
	/*每个页面公共css */
	/*每个页面公共css */
	@import url("/style/style.css");
	@import url("/style/style_rpx.css");
	@import "/style/ty_style_scss.scss";

	.appbg1 {
		background-color: #FF6B6B;
	}

	.yinyingtxt {
		text-shadow: 2px 2px 4px rgba(128, 128, 128, 0.75);
	}
</style>